<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Bean JSP Test</title>
</head>
<body>
<h3>Next bean use</h3>
<jsp:useBean id="userBean" class="mvp.levelup.web.bean.UserBean"/>
<jsp:setProperty name="userBean" property="id" value="1"/>
<jsp:setProperty name="userBean" property="name" value="Vasya"/>
<jsp:setProperty name="userBean" property="surname" value="The First"/>

<h3>Included</h3>
<jsp:include page="date.jsp" flush="true"/>
<% pageContext.setAttribute("myAttr", "myValue"); %>
<table>
    <tr>
        <td>Id</td>
        <td>Name</td>
        <td>Surname</td>
    </tr>
    <tr>
        <td>
            <jsp:getProperty name="userBean" property="id"/>
        </td>
        <td>
            <jsp:getProperty name="userBean" property="name"/>
        </td>
        <td>
            <jsp:getProperty name="userBean" property="surname"/>
        </td>
    </tr>
</table>

<h3>Page Attribute</h3>

<%= pageContext.getAttribute("myAttr")%>

<h3>From Session</h3>

<jsp:useBean id="userSessionBean" class="mvp.levelup.web.bean.UserSessionBean" scope="session"/>

<jsp:getProperty name="userSessionBean" property="login"/>
<jsp:getProperty name="userSessionBean" property="pass"/>

</body>
</html>
